<!doctype html>

<html lang="zh" xmlns:th="https://www.thymeleaf.org">
<head>
    <th:block th:include="include-front :: head('5180it','5180it')"/>
    <script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
    <script th:src="@{/ajax/libs/layui/layui.js}"></script>

    <link rel="stylesheet" href="/public/king/zplayer/css/zplayer.min.css" />
    <script type="text/javascript" src="/public/king/zplayer/js/zplayer.min.js?v=2" ></script>

    <!--右下角工具栏-->
    <th:block th:include="include-front-custom :: sidebar-css"/>

    <style>
        /*重写default.css演示*/
        .maybe-love ul li:nth-of-type(3), .maybe-love ul li:nth-of-type(4) {
            display:inline;
        }
        .maybe-love ul li{
            width: 30%;
        }
        /*重写右下角工具栏样式*/
        .jdc-side { display: none; position: fixed; right: 5px; bottom: 5px; z-index: 300; width: 60px }

    </style>
</head>
<body class="nobg">
<th:block th:replace="include-front-custom :: header"/>

<!--内容区开始-->l
<div class="container">
    <section style="width: 100%;">
        <div class="">
            <h4 class="index-title" id="New2"><i class="fa fa-paperclip"></i> 本站链接：</h4>
            <ul class="link-list">
                <li th:each="link:${links}">
                    <div class="link-item">
                        <a th:href="${'/f/linkRedirect?ref='+link.url+'&&id='+link.linkId}" target="_blank">
                            <img th:src="${link.headerImg}">
                            <h3 class="orange-text" th:text="${link.title}"></h3>
                            <p class="orange-text" th:text="${link.description}"></p>
                        </a>
                    </div>
                </li>
            </ul>
        </div>

        <!--<div class="maybe-love">
            <h4 class="index-title"><i class="fa fa-heart"></i>您还可能喜欢</h4>
            <ul>
                <li th:each="link:${links}">
                    <a th:href="${'/f/article/'+link.linkId+'.html'}">
                        <img
                                th:src="${link.headerImg}" th:alt="${link.title}"
                                th:title="${link.title}"/>
                        <span th:text="${link.description}"></span>
                    </a>
                </li>
            </ul>
        </div>-->
        
         <div style="height: 100px;">
	    </div>
    </section>
    

    <!--右下角工具栏-->
    <th:block th:replace="include-front-custom :: sidebar"/>

    <!--音乐播放器-->
    <th:block th:replace="include-front-custom :: musicplay"/>

</div>
<div style="height: 65px;margin-top: 20px;">
    <th:block th:replace="include-front :: footer"/>
</div>
<script>
    $(function () {
        if ($(".wall").children("li").length >= 10) {
            $(".pagintion").show();
            $(".wall").css("margin-bottom", "10px");
        } else {
            $(".pagination").hide();
            $(".wall").css("margin-bottom", "90px");
        }
    });

    function link() {
        if ($("#title").val() == "") {
            layer.msg('网站名称不能为空', {icon: 2});
            return false;
        }
        if ($("#email").val() == "") {
            layer.msg('邮箱不能为空喔', {icon: 2});
            return false;
        } else {
            var reg = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
            var email = $("#email").val();
            if (!reg.test(email)) {
                layer.msg('邮箱格式错误喔', {icon: 2});
                return false;
            }
        }
        if ($("#url").val() != "") {
            var reg = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/;
            var url = $("#url").val();
            if (!reg.test(url)) {
                layer.msg('网站格式错误喔，请输入带http格式的网址', {icon: 2});
                return false;
            }
        } else {
            layer.msg('网站地址不能为空', {icon: 2});
        }
        if ($("#description").val() == "") {
            layer.msg('网站描述不能为空', {icon: 2});
        }
        if ($("#description").val() == "") {
            layer.msg('网站描述不能为空', {icon: 2});
        }
        if ($("#headerImg").val() != "") {
            var reg = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/;
            var url = $("#headerImg").val();
            if (!reg.test(url)) {
                layer.msg('图标格式错误喔，请输入带http格式的图标', {icon: 2});
                return false;
            }
        } else {
            layer.msg('图标地址不能为空', {icon: 2});
        }
        var title = $("#title").val();
        var email = $("#email").val();
        var url = $("#url").val();
        var description = $("#description").val();
        var headerImg = $("#headerImg").val();
        $.ajax({
            type: "POST",
            // url:"ajax_feedback",
            url: "/f/applyLink",
            data: "title=" + title + "&email=" + email + "&url=" + url + "&description=" + description + "&headerImg=" + headerImg,
            dataType: "json",
            success: function (data) {
                if (data.code == 0) {
                    $("#title").val("");
                    $("#email").val("");
                    $("#url").val("");
                    $("#description").val("");
                    $("#headerImg").val("");
                    layer.msg('恭喜提交成功！待管理员审核通过后显示!', {icon: 1});
                    $("html, body").animate({
                        scrollTop: $("#applink").offset().top
                    }, {duration: 500, easing: "swing"});
                    return false;
                }
            },
            error: function (jqXHR) {
                layer.msg('发送错误：' + jqXHR.status, {icon: 2});
            },
        });

    }
</script>
</body>
</html>


